/*    ParseAbortException
/**
 * This exception is thrown when too many parse errors have been encountered
 * or when EOF has been reached.
 * This exception is not meant to be propagated outside of the parser.
 */
public class ParseAbortException extends Exception {
	
	private int maxerrors;

	// Only two instances of this class need to be created:
	// One to be used when there are too many syntax errors,
	// 		in which case the max parameter will be set to a number >0.
	// The other instance is to stop parsing because EOF has been reached.
	// 		In this case, the max parameter is set to EOF=0
	//
	public ParseAbortException(int max) {
		super	(	max==ParserConstants.EOF ?
					"EOF reached.  Parsing stopped." :
    				max + " syntax errors found.  Parsing failed."
				);
		maxerrors = max;
	}

	// isEOF returns true if the exception was thrown because EOF was reached
	public boolean isEOF()	{
		return (maxerrors == ParserConstants.EOF);
	}
}
